static char SccsId[] = "@(#)aslclrcd.c	1.4   10/6/95";
/*
 *         Copyright (c) KUBOTA Corporation and HUDSON SOFT,
 *                  1994, 1995 All Rights Reserved
 *
 *  This software comprises unpublished confidential information of
 *  KUBOTA Corp. and HUDSON SOFT. It may not be used, copied or made
 *  available to anyone, except in accordance with the license under
 *  which it is furnished.
 */

#define	_ASLLIB_
#define	_ASL_CLRCD_C_

#include <farl.h>
#include <asl.h>

/*----------------------------------------------------------------------------*/
void
ASLClearCollisionDetectionResult( int index, unsigned short value )
{
#if defined( __ASL_DEPEND_ON_FARL )
	register int		data, offset, shift;

	offset = ( index / 4 ) * 2;
	shift  = ( index % 4 ) * 4;
	data   = FarlGetMemReg( FARL_CD_RESULT_REG0 + offset );
	data  &= ~( 0x000f << shift );
	data  |=  ( value  << shift );
	FarlSetMemReg( FARL_CD_RESULT_REG0 + offset, data );
#else
	register unsigned int   *CDReg = (unsigned int *)FARL_CD_RESULT_REG0;
	register int		data, shift;

	shift  = index << 2;
	data   = *CDReg;
	data  &= ~( 0x000f << shift );
	data  |=  ( value  << shift );
	*CDReg = data;
#endif
}

/*----------------------------------------------------------------------------*/
